import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from './router'
import "./permission.js"
// 引入pinia
import pinia from './pinia'
// 
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import Pagination from "./components/pagination/index.vue"
import zhCn from 'element-plus/es/locale/lang/zh-cn'
// import './assets/style/element-variables.scss'
import './assets/style/header_layout.scss'
import './style.css'
// import 'element-plus/dist/index.css'

// 引入svg图标注册脚本
// import 'vite-plugin-svg-icons/register'

import ViewerPlugin from "@/utils/Viewer.js";
import { ViewerApi } from "@/utils/ViwerApi.js";

// // 引入 SVG 注册脚本（必须）
import 'virtual:svg-icons-register'

import SvgIcon from '@/components/SvgIcon/index.vue'

// 全局注册element-plus/icons-vue
import * as ICONS from '@element-plus/icons-vue'
const app = createApp(App)
Object.entries(ICONS).forEach(([key, component]) => {
  // app.component(key === 'PieChart' ? 'PieChartIcon' : key, component)
  app.component(key, component)
})
app.config.globalProperties.headerStyle = {
  height: '50px',
  fontWeight: "500",
  color:"#666",
  background: '#DBEBFE',
  'padding-left': '10px',
  'padding-right': '20px'
};
app.config.globalProperties.cellStyle = {
  'padding-left': '10px',
  'padding-right': '20px'
};
// console.log(ViewerApi,'ViewerApi');

app.config.globalProperties.$ViewerApi = ViewerApi.open;

app.component('Pagination', Pagination)
app.component('SvgIcon', SvgIcon)


// 全局注册（可传入默认配置，对所有预览生效）
// app.use(ViewerPlugin);
// console.log(ViewerPlugin);
ViewerPlugin.install(app);

app.use(ElementPlus)
app.use(pinia)
app.use(router)
app.mount('#app')
